﻿package view.mainUI.powerview
{
    import com.core.*;
    import consts.*;
    import flash.events.*;
    import morn.core.components.*;
    import uiresource.*;

    public class AttPanelCtrl extends AttPanelUI
    {

        public function AttPanelCtrl()
        {
            this.init();
            return;
        }// end function

        override protected function initialize() : void
        {
            super.initialize();
            return;
        }// end function

        private function init() : void
        {
            selectImg.mouseEnabled = false;
            label0.color = 5420593;
            label1.color = 12154699;
            label2.color = 13051156;
            label3.color = 4956382;
            label4.color = 14577110;
            var _loc_1:* = UserData.getUserData("career");
            if (_loc_1 == 1)
            {
                label2.text = "【全体模式】：伤害任何玩家或npc守卫\n按住shift可以强制跑位攻击哦！";
                btn1.y = 61 + 5;
                btn3.y = 89 + 5;
                btn4.y = 109 + 5;
                label1.y = 64 + 5;
                label3.y = 89 + 5;
                label4.y = 113 + 5;
            }
            else
            {
                label2.text = "【全体模式】：伤害任何玩家或npc守卫";
                btn1.y = 61 - 5;
                btn3.y = 89 - 5;
                btn4.y = 109 - 5;
                label1.y = 64 - 5;
                label3.y = 89 - 5;
                label4.y = 113 - 5;
            }
            label0.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            label1.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            label2.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            label3.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            label4.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            label0.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
            label1.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
            label2.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
            label3.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
            label4.addEventListener(MouseEvent.MOUSE_DOWN, this.onDown);
            ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_ZD1, label2);
            return;
        }// end function

        private function onOver(event:MouseEvent) : void
        {
            var _loc_2:int = 0;
            if (event.currentTarget == label2)
            {
                _loc_2 = UserData.getUserData("career");
                if (_loc_2 == 1)
                {
                    selectImg.height = 37;
                }
                else
                {
                    selectImg.height = 27;
                }
            }
            else
            {
                selectImg.height = 27;
            }
            selectImg.y = (event.currentTarget as Label).y - 4;
            return;
        }// end function

        private function onDown(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as Label;
            var _loc_3:int = 0;
            while (_loc_3 < 5)
            {
                
                if (_loc_2 == this["label" + _loc_3.toString()])
                {
                    ModelProxy.change("zone", "pkstate", _loc_3);
                }
                _loc_3++;
            }
            this.visible = false;
            ModelProxy.change("guide", "hide", GuideType.GUIDE_ZD1);
            return;
        }// end function

    }
}
